package com.fang.study.context;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author fanglingxiao
 * @version 1.0
 * @description TODO
 * @date 2021/12/28 12:13 上午
 **/
@Order(value = 100)
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		BeanDefinition user = beanFactory.getBeanDefinition("user");
		System.out.println("---------------");
		System.out.println("My BeanFactoryPosProcessor invoke:" + user.getBeanClassName());
		System.out.println("---------------");
	}
}
